#include "uart_read_work.h"
namespace UartNamespace {
//doWork定义了线程要执行的操作
void Worker::doWork(int parameter)
{
  qDebug()<<"receive the execute signal---------------------------------";
  qDebug()<<"     current thread ID:"<<QThread::currentThreadId();

  qDebug()<< "parameter:" << parameter;

  switch (parameter) {
    case UART_DATA_READ_READY: {
      uart_core_->UartBufferReady();
    }
    break;
  default:
    break;
  }

  //发送结束信号
  qDebug()<<"      finish the work and sent the resultReady signal\n";
  emit resultReady(parameter);
}

void Worker::SetUartCoreObj(Uartcore* uart_core) {
  uart_core_ = uart_core;
}
}
